package j06state;

public class J1 {
    static Object lock = new Object();
    public static void main(String[] args){
        Thread t1 = new Thread(()->{
            synchronized (lock){
                System.out.println("ok!");
            }
        });
       synchronized (lock) {
           t1.start();
           try {
               Thread.sleep(1000);
           } catch (InterruptedException e) {
               throw new RuntimeException(e);
           }
           lock.notify();
       }

    }
}
